package com.chixing.day15.day15_Home;

import java.io.File;

public class ShowDir {
    public static  void showDir(File dir){
        if(dir.exists()){
            File[] files = dir.listFiles();
            if(files != null){
                for(int i = 0; i < files.length; i++) {
                    if(files[i].isDirectory()) {
                        showDir(files[i]);
                    }else{
                        System.out.println(files[i]);
                    }
                }
            }
        }else{
            System.out.println("文件不存在");
        }
    }


    public static void main(String[] args){
        showDir(new File("//Users//jasonmarslyon//CX_Workspace//Java_Workspace//Test"));
    }
}

